class ModifyNotNullColumns < ActiveRecord::Migration
  def self.up
    change_column :users, :first_name, :string, :null => true
    change_column :users, :last_name, :string, :null => true
    change_column :users, :unique_name, :string, :null => true
    change_column :users, :password, :string, :null => true
    change_column :users, :email, :string, :null => true
    change_column :users, :status_uri, :string, :null => true
    
    change_column :articles, :user_id, :integer, :null => true
    change_column :articles, :title, :string, :null => true
    change_column :articles, :create_at, :datetime, :null => true
    change_column :articles, :guid, :string, :null => true
    change_column :articles, :blog_id, :string, :null => true, :default => 1
    
    change_column :comments, :content, :string, :null => true
    change_column :comments, :create_at, :datetime, :null => true
    change_column :comments, :article_id, :integer, :null => true
    
    change_column :tags, :name, :string, :null => true
  end

  def self.down
    change_column :users, :first_name, :string, :null => false
    change_column :users, :last_name, :string, :null => false
    change_column :users, :unique_name, :string, :null => false
    change_column :users, :password, :string, :null => false
    change_column :users, :email, :string, :null => false
    change_column :users, :status_uri, :string, :null => false
    
    change_column :articles, :user_id, :integer, :null => false
    change_column :articles, :title, :string, :null => false
    change_column :articles, :create_at, :datetime, :null => false
    change_column :articles, :guid, :string, :null => false
    change_column :articles, :blog_id, :string, :null => false, :default => 1
    
    change_column :comments, :content, :string, :null => false
    change_column :comments, :create_at, :datetime, :null => false
    change_column :comments, :article_id, :integer, :null => false
    
    change_column :tags, :name, :string, :null => false
  end
end
